# -*- coding: utf-8 -*- 
# @Time : 2023/6/16 16:45 
# @Author : gkm
# @File : cos_upload_demo.py
# appid 已在配置中移除,请在参数 Bucket 中带上 appid。Bucket 由 bucketname-appid 组成
# 1. 设置用户配置, 包括 secretId，secretKey 以及 Region
# -*- coding=utf-8
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client

secret_id = 'AKIDe7MM8g1AC1f5HG1KQIvLWSAeuwkJyPgl'
secret_key = 'vbAVcWCdrrfEZUDk3B8ye6NSL0TknbIl'
region = 'ap-nanjing'

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)

# 2. 获取客户端对象
client = CosS3Client(config)

response = client.create_bucket(
    Bucket='ceshi-1318238406',
    ACL="public-read",
)

# 成功！！！
